import request from './http.js'
import store from '../store/store'

export default {
	getOpenInfo: (data) => {
		return request.http({
			url: '/api/login/getwxopen',
			method: 'post',
			data: data
		})
	},
	wxLogin: (data) => {
		return request.http({
			url: '/api/login/miniapp',
			method: 'post',
			data: data
		})
	},
	//创建测试结果
	createTestResult: (data) => {
		return request.http({
			url: '/api/tests/create',
			method: 'post',
			data: data
		})
	},
	//获取测试结果
	getTestResult: (data) => {
		return request.http({
			url: '/api/tests/getTestResult',
			method: 'post',
			data: data
		})
	},

	//获取更多信息的创建订单
	createOrderForMoreInfo: (data) => {
		return request.http({
			url: '/api/pay/createPay',
			method: 'post',
			data: data
		})
	},

	//获取订单列表
	getOrderList: (params) => {
		return request.http({
			url: '/api/order/list',
			method: 'get',
			params: params
		})
	},


	//获取商品价格
	getPrice: (data) => {
		return request.http({
			url: '/api/pay/getPrice',
			method: 'post',
			data: data
		})
	},


	CreatePay: (data) => {
		return request.http({
			url: '/api/pay/createPay',
			method: 'post',
			data: data
		})
	},


	getTestResultInfo: (params) => {
		console.log("params:::", params)
		if (!params.TestId) {
			params.TestId = 0;
		}
		if (!params.orderId) {
			params.orderId = 0;
		}
		return request.http({
			url: '/api/tests/getTestResultInfo?orderId=' + params.orderId + "&TestId=" + params.TestId,
			method: 'get',
			params: params
		})
	},


	getTestsList: (params) => {
		return request.http({
			url: '/api/tests/list',
			method: 'get',
			params: params
		})
	},


		RandomQuestions: (data) => {
		return request.http({
			url: '/api/tests/RandomQuestions',
			method: 'post',
			data: data
		})
	},









}